﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessLogicLayer
{
    public class CollectionPointFacade
    {
        InventorySoreDataContext context;
        public CollectionPointFacade()
        {
            context = new InventorySoreDataContext();
        }
         public IQueryable FindAll()
        {
            var collections = from collection in context.CollectionPoints select collection;
            return collections;
        }
        public CollectionPoint FindCollectionById(string CollectionID)
        { 
            var collections =( from collection in context.CollectionPoints where collection.CollectionPointID == CollectionID select collection).Single();
      
            return collections;
        }
        public string GetLocation(String CollectionID)
        {
            var collections = (from location in context.CollectionPoints where location.CollectionPointID == CollectionID select location).Single();
            return collections.Location;

        }
        public TimeSpan GetTime(String CollectionID)
        {
            var collections = (from time in context.CollectionPoints where time.CollectionPointID == CollectionID select time).Single();
            return collections.Time.TimeOfDay;

        }
    }
}
